# coding:utf-8

__author__ = 'zed'

from django.conf import settings
from django.shortcuts import get_object_or_404, render_to_response
from django.template.context import RequestContext
from sitegear.intellect.data.models import IDataPage
from django.template.loader import get_template
from django.http import HttpResponse, Http404

def page_js(request):
    name = request.GET.get("slug","")
    obj = get_object_or_404(IDataPage, slug=name)
    template = get_template("data/js.html")

    c = RequestContext(request, dict(object=obj))

    return HttpResponse( template.render( c ) , content_type="application/x-javascript ")

